package com.zhuimeng.Application.entity;

import java.util.HashMap;
import java.util.Map;

public class message {
    private String code;
    private String mes;
    private Map<String, Object> ext = new HashMap<>();

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMes() {
        return mes;
    }

    public void setMes(String mes) {
        this.mes = mes;
    }

    public Map<String, Object> getExt() {
        return ext;
    }

    public void setExt(Map<String, Object> ext) {
        this.ext = ext;
    }

    @Override
    public String toString() {
        return "message{" +
                "code='" + code + '\'' +
                ", mes='" + mes + '\'' +
                ", ext=" + ext +
                '}';
    }

    public static message returnmessage(String code, String mes) {
        message message = new message();
        message.setCode(code);
        message.setMes(mes);
        return message;
    }

    public message add(String key, Object value) {
        this.getExt().put(key, value);
        return this;
    }
}
